﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<List<Dto.ManageMenuDto>>" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>欢迎进入网站管理平台</title>
    <meta name="author" content="http://design4u.cn,QQ:66383210,Email:caixfm@gmail.com" />
    <link href="/Content/css/incss.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="/Scripts/jquery-1.4.1.min.js"></script>
</head>
<body class="leftbody">
    <%
        foreach (ManageMenuDto dto in Model)
        {%>
    <div class="leftnav">
        <div class="navtitle">
            <a href="#">
                <%=dto.MenuName%></a></div>
        <ul id="ulChildMenu">
            <%
            int i = 0;%>
            <%
            foreach (ManageMenuDto childDto in dto.ChildMenuList)
            {%>
            <li id="liMenu<%=childDto.MenuID%>" <%=i == 0 ? "class=\"currenLink\"" : ""%>><a
                href="<%=Url.Action("ClickChildMenu", new {controller = "Home", id = childDto.MenuID})%>"
                target="mainFrame" onclick="ClickMenu(<%=childDto.MenuID%>);">
                <%=childDto.MenuName%></a></li>
            <%
                i++;%>
            <%
            }%>
        </ul>
    </div>
    <%
        }%>
    <script type="text/javascript">
        window.onload = function () {
            parent.mainFrame.location.href = '<%=Model[0].ChildMenuList != null && Model[0].ChildMenuList.Count > 0
                                  ? Model[0].ChildMenuList[0].MenuPath
                                  : ""%>';
        }

        function ClickMenu(id) {
            $("#ulChildMenu li").attr("class", "");
            $("#liMenu" + id).attr("class", "currenLink");
        }
    </script>
</body>
</html>
